import java.util.Arrays;
import java.lang.Math;
import java.util.Scanner;


public class LotteryDrawing {

  public static void main(String[] args) {

    Scanner in = new Scanner(System.in);

    System.out.print("How many numbers you need to draw? ");
    int n = in.nextInt();

    System.out.print("What's the highest number you can draw? ");
    int k = in.nextInt();

    int[] numbers = new int[k];
    for (int i = 0; i < numbers.length; i++)
      numbers[i] = i + 1;

    int[] result = new int[n];
    for (int j = 0; j < result.length; j++) {
      int r = (int) (Math.random() * k);
      result[j] = numbers[r];
      numbers[r] = numbers[k - 1];
      k--;
    }

    Arrays.sort(result);
    for (int i : result)
      System.out.print(i);
    System.out.print("\n");
  }

}
